package com.lin.chapter24;

public class Client {
	public static void main(String[] args) {
		Boy boy = new Boy();
		CareTaker careTaker = new CareTaker();
		boy.setState("心情很棒！");
		System.out.println("========男孩现在的状态=========");
		System.out.println(boy.getState());
		careTaker.setMemento(boy.createMemento());
		boy.changeState();
		System.out.println("\n=======男孩追女孩子后的状态=======");
		System.out.println(boy.getState());
		boy.restoreMemento(careTaker.getMemento());
		System.out.println("\n=======男孩恢复后的状态========");
		System.out.println(boy.getState());
	}
}
